#include "gfx/legato/generated/screen/le_gen_screen_Screen5.h"

// screen member widget declarations
leWidget* root0;

leWidget* Screen5_PanelWidget0;
leCircleWidget* Screen5_Circle10;
leCircleWidget* Screen5_Circle25;
leCircleWidget* Screen5_Circle40;
leCircleWidget* Screen5_Circle55;
leCircleWidget* Screen5_Circle70;
leCircleWidget* Screen5_Circle85;
leLineWidget* Screen5_Line0;
leLineWidget* Screen5_Line80;
leLineWidget* Screen5_Line160;
leLineWidget* Screen5_Line240;
leLineWidget* Screen5_Line320;
leLineWidget* Screen5_Line400;
leLineWidget* Screen5_Line480;
leRectangleWidget* Screen5_Rectangle800x480;
leRectangleWidget* Screen5_Rectangle780x460;
leRectangleWidget* Screen5_Rectangle760x440;
leRectangleWidget* Screen5_Rectangle740x420;
leLabelWidget* Screen5_TouchAnywhereLabel;

static leBool initialized = LE_FALSE;
static leBool showing = LE_FALSE;

leResult screenInit_Screen5(void)
{
    if(initialized == LE_TRUE)
        return LE_FAILURE;

    initialized = LE_TRUE;

    return LE_SUCCESS;
}

leResult screenShow_Screen5(void)
{
    if(showing == LE_TRUE)
        return LE_FAILURE;

    // layer 0
    root0 = leWidget_New();
    root0->fn->setSize(root0, 800, 480);
    root0->fn->setBackgroundType(root0, LE_WIDGET_BACKGROUND_NONE);
    root0->fn->setMargins(root0, 0, 0, 0, 0);
    root0->flags |= LE_WIDGET_IGNOREEVENTS;
    root0->flags |= LE_WIDGET_IGNOREPICK;

    Screen5_PanelWidget0 = leWidget_New();
    Screen5_PanelWidget0->fn->setPosition(Screen5_PanelWidget0, 0, 0);
    Screen5_PanelWidget0->fn->setSize(Screen5_PanelWidget0, 800, 480);
    Screen5_PanelWidget0->fn->setScheme(Screen5_PanelWidget0, &BaseBlack_ForegroundWhite);
    root0->fn->addChild(root0, (leWidget*)Screen5_PanelWidget0);

    Screen5_Circle10 = leCircleWidget_New();
    Screen5_Circle10->fn->setPosition(Screen5_Circle10, 0, 0);
    Screen5_Circle10->fn->setSize(Screen5_Circle10, 800, 480);
    Screen5_Circle10->fn->setScheme(Screen5_Circle10, &BaseBlack_ForegroundRed);
    Screen5_Circle10->fn->setRadius(Screen5_Circle10, 10);
    Screen5_Circle10->fn->setThickness(Screen5_Circle10, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Circle10);

    Screen5_Circle25 = leCircleWidget_New();
    Screen5_Circle25->fn->setPosition(Screen5_Circle25, 0, 0);
    Screen5_Circle25->fn->setSize(Screen5_Circle25, 800, 480);
    Screen5_Circle25->fn->setScheme(Screen5_Circle25, &BaseBlack_ForegroundRed);
    Screen5_Circle25->fn->setRadius(Screen5_Circle25, 25);
    Screen5_Circle25->fn->setThickness(Screen5_Circle25, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Circle25);

    Screen5_Circle40 = leCircleWidget_New();
    Screen5_Circle40->fn->setPosition(Screen5_Circle40, 0, 0);
    Screen5_Circle40->fn->setSize(Screen5_Circle40, 800, 480);
    Screen5_Circle40->fn->setScheme(Screen5_Circle40, &BaseBlack_ForegroundRed);
    Screen5_Circle40->fn->setRadius(Screen5_Circle40, 40);
    Screen5_Circle40->fn->setThickness(Screen5_Circle40, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Circle40);

    Screen5_Circle55 = leCircleWidget_New();
    Screen5_Circle55->fn->setPosition(Screen5_Circle55, 0, 0);
    Screen5_Circle55->fn->setSize(Screen5_Circle55, 800, 480);
    Screen5_Circle55->fn->setScheme(Screen5_Circle55, &BaseBlack_ForegroundRed);
    Screen5_Circle55->fn->setRadius(Screen5_Circle55, 55);
    Screen5_Circle55->fn->setThickness(Screen5_Circle55, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Circle55);

    Screen5_Circle70 = leCircleWidget_New();
    Screen5_Circle70->fn->setPosition(Screen5_Circle70, 0, 0);
    Screen5_Circle70->fn->setSize(Screen5_Circle70, 800, 480);
    Screen5_Circle70->fn->setScheme(Screen5_Circle70, &BaseBlack_ForegroundRed);
    Screen5_Circle70->fn->setRadius(Screen5_Circle70, 70);
    Screen5_Circle70->fn->setThickness(Screen5_Circle70, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Circle70);

    Screen5_Circle85 = leCircleWidget_New();
    Screen5_Circle85->fn->setPosition(Screen5_Circle85, 0, 0);
    Screen5_Circle85->fn->setSize(Screen5_Circle85, 800, 480);
    Screen5_Circle85->fn->setScheme(Screen5_Circle85, &BaseBlack_ForegroundRed);
    Screen5_Circle85->fn->setRadius(Screen5_Circle85, 85);
    Screen5_Circle85->fn->setThickness(Screen5_Circle85, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Circle85);

    Screen5_Line0 = leLineWidget_New();
    Screen5_Line0->fn->setPosition(Screen5_Line0, 0, 0);
    Screen5_Line0->fn->setSize(Screen5_Line0, 800, 480);
    Screen5_Line0->fn->setScheme(Screen5_Line0, &BaseBlack_ForgroundWhite);
    Screen5_Line0->fn->setBackgroundType(Screen5_Line0, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Line0->fn->setEndPoint(Screen5_Line0, 800, 480);
    root0->fn->addChild(root0, (leWidget*)Screen5_Line0);

    Screen5_Line80 = leLineWidget_New();
    Screen5_Line80->fn->setPosition(Screen5_Line80, 0, 0);
    Screen5_Line80->fn->setSize(Screen5_Line80, 800, 480);
    Screen5_Line80->fn->setScheme(Screen5_Line80, &BaseBlack_ForgroundWhite);
    Screen5_Line80->fn->setBackgroundType(Screen5_Line80, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Line80->fn->setStartPoint(Screen5_Line80, 0, 80);
    Screen5_Line80->fn->setEndPoint(Screen5_Line80, 800, 400);
    root0->fn->addChild(root0, (leWidget*)Screen5_Line80);

    Screen5_Line160 = leLineWidget_New();
    Screen5_Line160->fn->setPosition(Screen5_Line160, 0, 0);
    Screen5_Line160->fn->setSize(Screen5_Line160, 800, 480);
    Screen5_Line160->fn->setScheme(Screen5_Line160, &BaseBlack_ForgroundWhite);
    Screen5_Line160->fn->setBackgroundType(Screen5_Line160, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Line160->fn->setStartPoint(Screen5_Line160, 0, 160);
    Screen5_Line160->fn->setEndPoint(Screen5_Line160, 800, 320);
    root0->fn->addChild(root0, (leWidget*)Screen5_Line160);

    Screen5_Line240 = leLineWidget_New();
    Screen5_Line240->fn->setPosition(Screen5_Line240, 0, 0);
    Screen5_Line240->fn->setSize(Screen5_Line240, 800, 480);
    Screen5_Line240->fn->setScheme(Screen5_Line240, &BaseBlack_ForgroundWhite);
    Screen5_Line240->fn->setBackgroundType(Screen5_Line240, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Line240->fn->setStartPoint(Screen5_Line240, 0, 240);
    Screen5_Line240->fn->setEndPoint(Screen5_Line240, 800, 240);
    root0->fn->addChild(root0, (leWidget*)Screen5_Line240);

    Screen5_Line320 = leLineWidget_New();
    Screen5_Line320->fn->setPosition(Screen5_Line320, 0, 0);
    Screen5_Line320->fn->setSize(Screen5_Line320, 800, 480);
    Screen5_Line320->fn->setScheme(Screen5_Line320, &BaseBlack_ForgroundWhite);
    Screen5_Line320->fn->setBackgroundType(Screen5_Line320, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Line320->fn->setStartPoint(Screen5_Line320, 0, 320);
    Screen5_Line320->fn->setEndPoint(Screen5_Line320, 800, 160);
    root0->fn->addChild(root0, (leWidget*)Screen5_Line320);

    Screen5_Line400 = leLineWidget_New();
    Screen5_Line400->fn->setPosition(Screen5_Line400, 0, 0);
    Screen5_Line400->fn->setSize(Screen5_Line400, 800, 480);
    Screen5_Line400->fn->setScheme(Screen5_Line400, &BaseBlack_ForgroundWhite);
    Screen5_Line400->fn->setBackgroundType(Screen5_Line400, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Line400->fn->setStartPoint(Screen5_Line400, 0, 400);
    Screen5_Line400->fn->setEndPoint(Screen5_Line400, 800, 80);
    root0->fn->addChild(root0, (leWidget*)Screen5_Line400);

    Screen5_Line480 = leLineWidget_New();
    Screen5_Line480->fn->setPosition(Screen5_Line480, 0, 0);
    Screen5_Line480->fn->setSize(Screen5_Line480, 800, 480);
    Screen5_Line480->fn->setScheme(Screen5_Line480, &BaseBlack_ForgroundWhite);
    Screen5_Line480->fn->setBackgroundType(Screen5_Line480, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Line480->fn->setStartPoint(Screen5_Line480, 0, 480);
    Screen5_Line480->fn->setEndPoint(Screen5_Line480, 800, 0);
    root0->fn->addChild(root0, (leWidget*)Screen5_Line480);

    Screen5_Rectangle800x480 = leRectangleWidget_New();
    Screen5_Rectangle800x480->fn->setPosition(Screen5_Rectangle800x480, 0, 0);
    Screen5_Rectangle800x480->fn->setSize(Screen5_Rectangle800x480, 800, 480);
    Screen5_Rectangle800x480->fn->setScheme(Screen5_Rectangle800x480, &BaseBlack_ForegroundLightgreen);
    Screen5_Rectangle800x480->fn->setBackgroundType(Screen5_Rectangle800x480, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Rectangle800x480->fn->setBorderType(Screen5_Rectangle800x480, LE_WIDGET_BORDER_NONE);
    Screen5_Rectangle800x480->fn->setThickness(Screen5_Rectangle800x480, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Rectangle800x480);

    Screen5_Rectangle780x460 = leRectangleWidget_New();
    Screen5_Rectangle780x460->fn->setPosition(Screen5_Rectangle780x460, 10, 10);
    Screen5_Rectangle780x460->fn->setSize(Screen5_Rectangle780x460, 780, 460);
    Screen5_Rectangle780x460->fn->setScheme(Screen5_Rectangle780x460, &BaseBlack_ForegroundSkyblue);
    Screen5_Rectangle780x460->fn->setBackgroundType(Screen5_Rectangle780x460, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Rectangle780x460->fn->setBorderType(Screen5_Rectangle780x460, LE_WIDGET_BORDER_NONE);
    Screen5_Rectangle780x460->fn->setThickness(Screen5_Rectangle780x460, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Rectangle780x460);

    Screen5_Rectangle760x440 = leRectangleWidget_New();
    Screen5_Rectangle760x440->fn->setPosition(Screen5_Rectangle760x440, 20, 20);
    Screen5_Rectangle760x440->fn->setSize(Screen5_Rectangle760x440, 760, 440);
    Screen5_Rectangle760x440->fn->setScheme(Screen5_Rectangle760x440, &BaseBlack_ForegroudYellow);
    Screen5_Rectangle760x440->fn->setBackgroundType(Screen5_Rectangle760x440, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Rectangle760x440->fn->setBorderType(Screen5_Rectangle760x440, LE_WIDGET_BORDER_NONE);
    Screen5_Rectangle760x440->fn->setThickness(Screen5_Rectangle760x440, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Rectangle760x440);

    Screen5_Rectangle740x420 = leRectangleWidget_New();
    Screen5_Rectangle740x420->fn->setPosition(Screen5_Rectangle740x420, 30, 30);
    Screen5_Rectangle740x420->fn->setSize(Screen5_Rectangle740x420, 740, 420);
    Screen5_Rectangle740x420->fn->setScheme(Screen5_Rectangle740x420, &BaseBlack_ForegroundPerple);
    Screen5_Rectangle740x420->fn->setBackgroundType(Screen5_Rectangle740x420, LE_WIDGET_BACKGROUND_NONE);
    Screen5_Rectangle740x420->fn->setBorderType(Screen5_Rectangle740x420, LE_WIDGET_BORDER_NONE);
    Screen5_Rectangle740x420->fn->setThickness(Screen5_Rectangle740x420, 2);
    root0->fn->addChild(root0, (leWidget*)Screen5_Rectangle740x420);

    Screen5_TouchAnywhereLabel = leLabelWidget_New();
    Screen5_TouchAnywhereLabel->fn->setPosition(Screen5_TouchAnywhereLabel, 80, 440);
    Screen5_TouchAnywhereLabel->fn->setSize(Screen5_TouchAnywhereLabel, 660, 30);
    Screen5_TouchAnywhereLabel->fn->setScheme(Screen5_TouchAnywhereLabel, &BaseWhite_TextBlack);
    Screen5_TouchAnywhereLabel->fn->setHAlignment(Screen5_TouchAnywhereLabel, LE_HALIGN_CENTER);
    Screen5_TouchAnywhereLabel->fn->setVAlignment(Screen5_TouchAnywhereLabel, LE_VALIGN_TOP);
    Screen5_TouchAnywhereLabel->fn->setString(Screen5_TouchAnywhereLabel, (leString*)&string_TouchAnywhere);
    root0->fn->addChild(root0, (leWidget*)Screen5_TouchAnywhereLabel);

    leAddRootWidget(root0, 0);
    leSetLayerColorMode(0, LE_COLOR_MODE_RGB_565);

    showing = LE_TRUE;

    return LE_SUCCESS;
}

void screenUpdate_Screen5(void)
{
}

void screenHide_Screen5(void)
{

    leRemoveRootWidget(root0, 0);
    leWidget_Delete(root0);
    root0 = NULL;

    Screen5_PanelWidget0 = NULL;
    Screen5_Circle10 = NULL;
    Screen5_Circle25 = NULL;
    Screen5_Circle40 = NULL;
    Screen5_Circle55 = NULL;
    Screen5_Circle70 = NULL;
    Screen5_Circle85 = NULL;
    Screen5_Line0 = NULL;
    Screen5_Line80 = NULL;
    Screen5_Line160 = NULL;
    Screen5_Line240 = NULL;
    Screen5_Line320 = NULL;
    Screen5_Line400 = NULL;
    Screen5_Line480 = NULL;
    Screen5_Rectangle800x480 = NULL;
    Screen5_Rectangle780x460 = NULL;
    Screen5_Rectangle760x440 = NULL;
    Screen5_Rectangle740x420 = NULL;
    Screen5_TouchAnywhereLabel = NULL;


    showing = LE_FALSE;
}

void screenDestroy_Screen5(void)
{
    if(initialized == LE_FALSE)
        return;

    initialized = LE_FALSE;
}

leWidget* screenGetRoot_Screen5(uint32_t lyrIdx)
{
    if(lyrIdx >= LE_LAYER_COUNT)
        return NULL;

    switch(lyrIdx)
    {
        case 0:
        {
            return root0;
        }
        default:
        {
            return NULL;
        }
    }
}

